package com.tutu.borrow;

import com.tutu.feign.config.FeignClientConfig;
import com.tutu.feign.feignclient.BookClient;
import com.tutu.feign.feignclient.UserClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;

/**
 * @Program: SpringCloud
 * @Description:
 * @Author: JK.TuTu
 * @Version: 1.0
 * @Create: 2022-12-01 11:49
 **/
@Slf4j
@EnableHystrix   //启用Hystrix
//@ComponentScan(basePackages = {"com.tutu.feign.feignclient"})
@SpringBootApplication
//开启openfeign    defaultConfiguration:开启全局配置feign日志的配置类  clients:自定义openfigen客户端
@EnableFeignClients(defaultConfiguration = FeignClientConfig.class,clients = {UserClient.class, BookClient.class})
//@FeignClient(value = "book-server",configuration = FeignClientConfig.class)  //指定服务的配置feign日志
public class BorrowApplication {
    public static void main(String[] args) {
        SpringApplication.run(BorrowApplication.class, args);
        log.info("Borrow-Service项目已启动.........");
    }
}
